package projetosig

import grails.converters.JSON
import groovy.sql.Sql

class WebController {

	def dataSource

	def getSQLQueryResult(String query) {
		def result
		try {
			def sql = new Sql(dataSource)
			result = sql.rows(query)
		} catch (Exception e) {
			result = e.getMessage()
		}
		render(result as JSON)
	}
}
